﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Description;

namespace WcfContrib.Extensions.Behaviors
{
    /// <summary>
    /// A behavior that increases the max items in object graph to the maximum value.
    /// </summary>
    public class BoostedSerializerOperationBehavior : DataContractSerializerOperationBehavior
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="BoostedSerializerOperationBehavior"/> class.
        /// </summary>
        /// <param name="operation">The operation description.</param>
        public BoostedSerializerOperationBehavior(OperationDescription operation)
            : base(operation)
        {
            MaxItemsInObjectGraph = int.MaxValue;
        }
    }
}
